# -*- encoding: utf-8 -*-
"""

PyCharm 16使用scatter函数绘制气泡图
2024年 10月 27日 15:18
coded by wenyang
文件的主要内容


"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl


def main():
    mpl.rcParams['font.sans-serif'] = ['SimHei']
    mpl.rcParams['axes.unicode_minus'] = False
    a = np.random.randn(100)
    b = np.random.randn(100)
    # 设置映射颜色就是 RdYlBu
    plt.scatter(a, b, s = np.power(10 * a + 20 * b, 2), c = np.random.randn(100), cmap = mpl.cm.RdYlBu, alpha = 0.6, marker = "o")
    plt.title("气泡图的绘制")
    plt.show()



if __name__ == "__main__":
    main()
